package com.gwtsolutions.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class LoginStart implements EntryPoint
{
	@Override
	public void onModuleLoad()
	{
		final Label loginPrompt = new Label("Please log in!");
		final Grid grid = new Grid(3, 2);
		final Label namePrompt = new Label("Name: ");
		final TextBox nameTextBox = new TextBox();
		final Label passwordPrompt = new Label("Password: ");
		final PasswordTextBox passwordTextbox = new PasswordTextBox();
		final Button button = new Button("Login");
		
		grid.setWidget(0, 0, namePrompt);
		grid.setWidget(0, 1, nameTextBox);
		
		grid.setWidget(1, 0, passwordPrompt);
		grid.setWidget(1, 1, passwordTextbox);
		
		grid.setWidget(2, 1, button);
		
		RootPanel.get().add(loginPrompt);
		RootPanel.get().add(grid);
		
		loginPrompt.addStyleName("loginPrompt");
		nameTextBox.addStyleName("nameField");
		passwordTextbox.addStyleName("passwordField");
	} 
}
